package com.study.mike.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.study.mike.common.enums.OrderStatusEnum;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * @author KangHui
 * @Date 2022/8/29 17:05
 */
@TableName("sale_order")
@Data
public class SaleOrder {
    /**
     * 主键
     */
    @TableId(value = "id",type = IdType.AUTO)
    private Long id;

    /**
     * 订单号
     */
    @TableField("order_sn")
    private String orderSn;

    /**
     * 订单状态1-已发起 2-已审核 3-已确认 4-已完成
     */
    @TableField("status")
    private OrderStatusEnum status;

    /**
     * 订单金额
     */
    @TableField("order_account")
    private BigDecimal orderAccount;

    /**
     * 下单时间
     */
    @TableField("pay_time")
    private LocalDateTime payTime;

    /**
     * 创建时间
     */
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    /**
     * 删除标识
     */
    @TableLogic
    @TableField("delete_flag")
    private Integer deleteFlag;

}
